home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / AmigaTalk_X / system / DosFlags.st < prev    next >
Encoding:
Text File  |  2002-03-13  |  50.1 KB  |  1,214 lines

  1. "----------------------------------------------------------------------"
  2. " I would prefer to have only one large Dictionary of all AmigaDOS     "
  3. " flags & tags, but since Little Smalltalk only uses 8-bit bytecodes,  "
  4. " a Dictionary is limitied to 256 entries, so I had to divide the flags"
  5. " into several smaller dictionaries.  You can use this one Class to    "
  6. " reference ALL the components using the getXX: methods (jts).         "
  7. " This Class is a Singleton-class.                                     "
  8. ""
  9. " ALL singleton classes MUST contain the following:                    "
  10. ""
  11. "   the methods:  isSingleton AND privateSetup     AND                 "
  12. "                 uniqueInstance Class instance variable.              "
  13. "----------------------------------------------------------------------"
  14.  
  15. Class DosSystem :Dictionary 
  16. ! uniqueInstance dateTime  aslFlags  exAllFlags dosFlags dosErrors dosPackets 
  17.   dosFHFlags     dosNotify dosRDArgs dosRecord  dosStdio dosVar    dosHunks
  18. !
  19. [
  20.    isSingleton
  21.      ^ true  
  22. |  
  23.    privateNew ! newinstance !
  24.      newinstance <- super new.
  25.  
  26.      ^ newinstance
  27. |
  28.    new
  29.      ^ (self privateSetup)
  30. |
  31.    privateSetup
  32.      (uniqueInstance isNil)
  33.        ifTrue: [uniqueInstance <- self privateNew.
  34.  
  35.                 dateTime   <- DosDateTimeFlags new.
  36.                 aslFlags   <- DosASLFlags      new.
  37.                 exAllFlags <- DosExAllFlags    new.
  38.                 dosFlags   <- DosFlags         new.
  39.                 dosErrors  <- DosErrors        new.
  40.                 dosPackets <- DosPackets       new.
  41.                 dosFHFlags <- DosFH            new.
  42.                 dosNotify  <- DosNotifyFlags   new.
  43.                 dosRDArgs  <- DosRDArgsFlags   new.
  44.                 dosRecord  <- DosRecordFlags   new.
  45.                 dosStdio   <- DosStdIOFlags    new.
  46.                 dosVar     <- DosVarFlags      new.
  47.                 dosHunks   <- DosHunks         new.
  48.                ].
  49.                
  50.      ^ self    "or ^ uniqueInstance??"
  51. |
  52.    getDateTime: indexSymbol
  53.      ^ dateTime   at: indexSymbol
  54. |
  55.    getASLFlag: indexSymbol
  56.      ^ aslFlags   at: indexSymbol
  57. |
  58.    getExAllFlag: indexSymbol
  59.      ^ exAllFlags at: indexSymbol
  60. |
  61.    getDosFlag: indexSymbol
  62.      ^ dosFlags   at: indexSymbol
  63. |
  64.    getDosError: indexSymbol
  65.      ^ dosErrors  at: indexSymbol
  66. |
  67.    getDosPacket: indexSymbol
  68.      ^ dosPackets at: indexSymbol
  69. |
  70.    getDosFHFlag: indexSymbol
  71.      ^ dosFHFlags at: indexSymbol
  72. |
  73.    getDosNotify: indexSymbol
  74.      ^ dosNotify  at: indexSymbol
  75. |
  76.    getDosRDArg: indexSymbol
  77.      ^ dosRDArgs  at: indexSymbol
  78. |
  79.    getDosRecord: indexSymbol
  80.      ^ dosRecord  at: indexSymbol
  81. |
  82.    getDosStdio: indexSymbol
  83.      ^ dosStdio   at: indexSymbol
  84. |
  85.    getDosVar: indexSymbol
  86.      ^ dosVar     at: indexSymbol
  87. |
  88.    getDosHunk: indexSymbol
  89.      ^ dosHunks   at: indexSymbol
  90. ]
  91.  
  92. "----------------------------------------------------------------------"
  93. " DosASLFlags Class implements flags & tags used by the AmigaDOS       "
  94. " functions for AmigaTalk.  This class is a Singleton-class.           "
  95. ""
  96. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  97. " methods of this Class -- it's really getting hard to document each   "
  98. " AmigaTalk Class in two or more places!                               "
  99. ""
  100. " ALL singleton classes MUST contain the following:                    "
  101. ""
  102. "   the methods:  isSingleton AND privateSetup     AND                 "
  103. "                 uniqueInstance Class instance variable.              "
  104. " ---------------------------------------------------------------------"
  105.  
  106. Class DosASLFlags :Dictionary ! uniqueInstance !
  107. [
  108.    isSingleton
  109.      ^ true  
  110. |  
  111.    privateNew ! newinstance !
  112.      newinstance <- super new.
  113.  
  114.      ^ newinstance
  115. |
  116.    new
  117.      ^ (self privateSetup)
  118. |
  119.    privateSetup
  120.      (uniqueInstance isNil)
  121.        ifTrue: [uniqueInstance <- self privateNew.
  122.  
  123.                 " dos/DosASL.h flags: "
  124.  
  125.                 self at: #APF_DOWILD         put: 1.   " User option ALL "
  126.                 self at: #APF_ITSWILD        put: 2.   " Set by MatchFirst, used by MatchNext "
  127.                 self at: #APF_DODIR          put: 4.   " Set if a Dir node should be entered "
  128.                 self at: #APF_DIDDIR         put: 8.   " Bit is SET for an 'expired' dir node "
  129.                 self at: #APF_NOMEMERR       put: 16.  " Set on memory error "
  130.                 self at: #APF_DODOT          put: 32.  " If set, allow conv'n of '.' toCurrentDir "
  131.                 self at: #APF_DirChanged     put: 64.  " an_Lock changed since last MatchNext call "
  132.                 self at: #APF_FollowHLinks   put: 128. " follow hardlinks on a DODIR. "
  133.  
  134.                 self at: #DDF_PatternBit     put: 1.
  135.                 self at: #DDF_ExaminedBit    put: 2.
  136.                 self at: #DDF_Completed      put: 4.
  137.                 self at: #DDF_AllBit         put: 8.
  138.                 self at: #DDF_Single         put: 16.
  139.  
  140.                 " Constants used by wildcard routines, these are the pre-parsed tokens
  141.                 * referred to by pattern match.  It is not necessary for you to do
  142.                 * anything about these, matchFirst: & matchNext handle all these for you.
  143.                 "
  144.                 self at: #P_ANY              put: 16r80. " Token for '*' or '#? "
  145.                 self at: #P_SINGLE           put: 16r81. " Token for '?' "
  146.                 self at: #P_ORSTART          put: 16r82. " Token for '(' "
  147.                 self at: #P_ORNEXT           put: 16r83. " Token for '|' "
  148.                 self at: #P_OREND            put: 16r84. " Token for ')' "
  149.                 self at: #P_NOT              put: 16r85. " Token for '~' "
  150.                 self at: #P_NOTEND           put: 16r86.
  151.                 self at: #P_NOTCLASS         put: 16r87. " Token for '^' "
  152.                 self at: #P_CLASS            put: 16r88. " Token for '[]' "
  153.                 self at: #P_REPBEG           put: 16r89. " Token for '[' "
  154.                 self at: #P_REPEND           put: 16r8A. " Token for ']' "
  155.                 self at: #P_STOP             put: 16r8B. " token to force end of evaluation "
  156.  
  157.                 " Values for an_Status, NOTE: These are the actual bit numbers: "
  158.  
  159.                 self at: #COMPLEX_BIT        put: 1.     " Parsing complex pattern "
  160.                 self at: #EXAMINE_BIT        put: 2.     " Searching directory "
  161.                ].
  162.                
  163.      ^ self    "or ^ uniqueInstance??"
  164. ]
  165.  
  166.  
  167. "----------------------------------------------------------------------"
  168. " DosExAllFlags Class implements exAll flags & tags used by the        "
  169. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  170. ""
  171. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  172. " methods of this Class -- it's really getting hard to document each   "
  173. " AmigaTalk Class in two or more places!                               "
  174. ""
  175. " ALL singleton classes MUST contain the following:                    "
  176. ""
  177. "   the methods:  isSingleton AND privateSetup     AND                 "
  178. "                 uniqueInstance Class instance variable.              "
  179. " ---------------------------------------------------------------------"
  180.  
  181. Class DosExAllFlags :Dictionary ! uniqueInstance !
  182. [
  183.    isSingleton
  184.      ^ true  
  185. |  
  186.    privateNew ! newinstance !
  187.      newinstance <- super new.
  188.  
  189.      ^ newinstance
  190. |
  191.    new
  192.      ^ (self privateSetup)
  193. |
  194.    privateSetup
  195.      (uniqueInstance isNil)
  196.        ifTrue: [uniqueInstance <- self privateNew.
  197.  
  198.                 " dos/ExAll.h flags: "
  199.  
  200.                 " NOTE: V37 dos.library, when doing ExAll() emulation, and V37 filesystems
  201.                 * will return an error if passed ED_OWNER.  If you get ERROR_BAD_NUMBER,
  202.                 * retry with ED_COMMENT to get everything but owner info.  All filesystems
  203.                 * supporting ExAll() must support through ED_COMMENT, and must check Type
  204.                 * and return ERROR_BAD_NUMBER if they don't support the type.
  205.                 "
  206.  
  207.                 " values that can be passed for what data you want from ExAll()
  208.                 * each higher value includes those below it (numerically)
  209.                 * you MUST choose one of these values 
  210.                 "
  211.  
  212.                 self at: #ED_NAME        put: 1.
  213.                 self at: #ED_TYPE        put: 2. " Name and Type "
  214.                 self at: #ED_SIZE        put: 3. " Name, Type & Size "
  215.                 self at: #ED_PROTECTION  put: 4. " Name, Type, Size & Protection bits "
  216.                 self at: #ED_DATE        put: 5.
  217.                 self at: #ED_COMMENT     put: 6.
  218.                 self at: #ED_OWNER       put: 7. " The whole enchilada! "
  219.                ].
  220.                
  221.      ^ self    "or ^ uniqueInstance??"
  222. ]
  223.  
  224. "----------------------------------------------------------------------"
  225. " DosFlags Class implements Dos & DosExtens flags & tags used by the   "
  226. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  227. ""
  228. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  229. " methods of this Class -- it's really getting hard to document each   "
  230. " AmigaTalk Class in two or more places!                               "
  231. ""
  232. " ALL singleton classes MUST contain the following:                    "
  233. ""
  234. "   the methods:  isSingleton AND privateSetup     AND                 "
  235. "                 uniqueInstance Class instance variable.              "
  236. " ---------------------------------------------------------------------"
  237.  
  238. Class DosFlags :Dictionary ! uniqueInstance !
  239. [
  240.    isSingleton
  241.      ^ true  
  242. |  
  243.    privateNew ! newinstance !
  244.      newinstance <- super new.
  245.  
  246.      ^ newinstance
  247. |
  248.    new
  249.      ^ (self privateSetup)
  250. |
  251.    privateInitializeDictionary      "Too big to be in a Block:"
  252.  
  253.      " dos/dos.h: flags: "
  254.  
  255.      self at: #DOSFALSE put:  0.
  256.      self at: #DOSTRUE  put: -1.
  257.  
  258.      self at: #MODE_OLDFILE     put: 1005. " Open existing file as read/write "
  259.      self at: #MODE_NEWFILE     put: 1006. " Open freshly created file read/write "
  260.      self at: #MODE_READWRITE   put: 1004. " Open old file w/shared lock "
  261.  
  262.      " Relative position to seekFile: "
  263.  
  264.      self at: #OFFSET_BEGINNING put: -1.      " relative to Beginning Of File "
  265.      self at: #OFFSET_CURRENT   put:  0.      " relative to Current file position "
  266.      self at: #OFFSET_END       put:  1.      " relative to End Of File "
  267.  
  268.      " Passed as type to lock: "
  269.  
  270.      self at: #SHARED_LOCK      put: -2.      " File is readable by others "
  271.      self at: #ACCESS_READ      put: -2.      " Synonym "
  272.      self at: #EXCLUSIVE_LOCK   put: -1.      " No other access allowed "
  273.      self at: #ACCESS_WRITE     put: -1.      " Synonym "
  274.  
  275.      self at: #TICKS_PER_SECOND put: 50.      " Number of ticks in one second "
  276.  
  277.      self at: #FIBF_OTR_READ    put: 16r8000. " Other: file is readable "
  278.      self at: #FIBF_OTR_WRITE   put: 16r4000. " Other: file is writable "
  279.      self at: #FIBF_OTR_EXECUTE put: 16r2000. " Other: file is executable "
  280.      self at: #FIBF_OTR_DELETE  put: 16r1000. " Other: prevent file from being deleted "
  281.      self at: #FIBF_GRP_READ    put: 16r800.  " Group: file is readable "
  282.      self at: #FIBF_GRP_WRITE   put: 16r400.  " Group: file is writable "
  283.      self at: #FIBF_GRP_EXECUTE put: 16r200.  " Group: file is executable "
  284.      self at: #FIBF_GRP_DELETE  put: 16r100.  " Group: prevent file from being deleted "
  285.      self at: #FIBF_HIDDEN      put: 16r80.   " file is hidden from casual scrutiny "
  286.      self at: #FIBF_SCRIPT      put: 16r40.   " file is a script (execute) file "
  287.      self at: #FIBF_PURE        put: 16r20.   " program is reentrant and rexecutable "
  288.      self at: #FIBF_ARCHIVE     put: 16r10.   " cleared whenever file is changed "
  289.      self at: #FIBF_READ        put: 8.       " File is readable "
  290.      self at: #FIBF_WRITE       put: 4.       " File is writeable "
  291.      self at: #FIBF_EXECUTE     put: 2.       " Executable by a Shell "
  292.      self at: #FIBF_DELETE      put: 1.       " prevent file from being deleted "
  293.  
  294.      self at: #FAULT_MAX        put: 82.      " Maximum length of falut string "
  295.  
  296.      " ID stands for InfoData, Disk States: "
  297.  
  298.      self at: #ID_WRITE_PROTECTED put: 80. " Disk is write protected "
  299.      self at: #ID_VALIDATING      put: 81. " Disk is currently being validated "
  300.      self at: #ID_VALIDATED       put: 82. " Disk is consistent and writeable "
  301.  
  302.      " Disk types: "
  303.  
  304.      self at: #ID_NO_DISK_PRESENT  put: -1.
  305.      self at: #ID_UNREADABLE_DISK  put: 16r42414400. " 'BAD\0' "
  306.      self at: #ID_DOS_DISK         put: 16r444F5300. " 'DOS\0' "
  307.      self at: #ID_FFS_DISK         put: 16r444F5301. " 'DOS\1' "
  308.      self at: #ID_INTER_DOS_DISK   put: 16r444F5302. " 'DOS\2' "
  309.      self at: #ID_INTER_FFS_DISK   put: 16r444F5303. " 'DOS\3' "
  310.      self at: #ID_FASTDIR_DOS_DISK put: 16r444F5304. " 'DOS\4' "
  311.      self at: #ID_FASTDIR_FFS_DISK put: 16r444F5305. " 'DOS\5' "
  312.      self at: #ID_NOT_REALLY_DOS   put: 16r4E444F53. " 'NDOS'  "
  313.      self at: #ID_KICKSTART_DISK   put: 16r4B49434B. " 'KICK'  "
  314.      self at: #ID_MSDOS_DISK       put: 16r4D534400. " 'MSD\0' "
  315.  
  316.      " setSignal( 0, 0 ) & SIGBREAKF_CTRL_C != false, then cleanup_and_exit() "
  317.  
  318.      self at: #SIGBREAKF_CTRL_C   put: 16r1000.
  319.      self at: #SIGBREAKF_CTRL_D   put: 16r2000.
  320.      self at: #SIGBREAKF_CTRL_E   put: 16r4000.
  321.      self at: #SIGBREAKF_CTRL_F   put: 16r8000.
  322.  
  323.      " Values returned by sameLock: "
  324.  
  325.      self at: #LOCK_DIFFERENT     put: -1.
  326.      self at: #LOCK_SAME          put: 0.
  327.      self at: #LOCK_SAME_VOLUME   put: 1. " locks are on same volume "
  328.  
  329.      " types for changeMode: "
  330.  
  331.      self at: #CHANGE_LOCK        put: 0.
  332.      self at: #CHANGE_FH          put: 1.
  333.  
  334.      " Values for makeLink: "
  335.  
  336.      self at: #LINK_HARD          put: 0.
  337.      self at: #LINK_SOFT          put: 1. " softlinks are not fully supported yet "
  338.  
  339.      " values returned by readItem: "
  340.  
  341.      self at: #ITEM_EQUAL         put: -2. " '=' Symbol "
  342.      self at: #ITEM_ERROR         put: -1. " error "
  343.      self at: #ITEM_NOTHING       put: 0.  " *N, ;, endstreamch "
  344.      self at: #ITEM_UNQUOTED      put: 1.  " unquoted item "
  345.      self at: #ITEM_QUOTED        put: 2.  " quoted item "
  346.  
  347.      " types for allocDosObject & freeDosObject: "
  348.  
  349.      self at: #DOS_FILEHANDLE     put: 0. " few people should use this "
  350.      self at: #DOS_EXALLCONTROL   put: 1. " Must be used to allocate exAllControl! "
  351.      self at: #DOS_FIB            put: 2. " For FileInfoBlock "
  352.      self at: #DOS_STDPKT         put: 3. " for doing packet-level I/O "
  353.      self at: #DOS_CLI            put: 4. " for shell-writers, etc "
  354.      self at: #DOS_RDARGS         put: 5. " for ReadArgs if you pass it in "
  355.  
  356.      " dos/DosExtens.h flags: "
  357.   
  358.      " Flags for process->pr_Flags "
  359.  
  360.      self at: #PRF_FREESEGLIST         put: 1.
  361.      self at: #PRF_FREECURRDIR         put: 2.
  362.      self at: #PRF_FREECLI             put: 4.
  363.      self at: #PRF_CLOSEINPUT          put: 8.
  364.      self at: #PRF_CLOSEOUTPUT         put: 16.
  365.      self at: #PRF_FREEARGS            put: 32.
  366.  
  367.      self at: #RNF_WILDSTAR            put: 16r1000000. " for rootNode"
  368.  
  369.      " Segment use codes: "
  370.  
  371.      self at: #CMD_SYSTEM              put: -1.
  372.      self at: #CMD_INTERNAL            put: -2.
  373.      self at: #CMD_DISABLED            put: -999.
  374.  
  375.      " definitions for dl_Type "
  376.  
  377.      self at: #DLT_DEVICE              put: 0.
  378.      self at: #DLT_DIRECTORY           put: 1.  " assign                "
  379.      self at: #DLT_VOLUME              put: 2.
  380.      self at: #DLT_LATE                put: 3.  " late-binding assign   "
  381.      self at: #DLT_NONBINDING          put: 4.  " non-binding assign    "
  382.      self at: #DLT_PRIVATE             put: -1. " for internal use only "
  383.  
  384.      " definitions for (DevProc structure) dvp_Flags "
  385.  
  386.      self at: #DVPF_UNLOCK             put: 1. " PRIVATE! "
  387.      self at: #DVPF_ASSIGN             put: 2.
  388.  
  389.      " Flags to be passed to lockDosList:, etc "
  390.  
  391.      self at: #LDF_DEVICES             put: 4.
  392.      self at: #LDF_VOLUMES             put: 8.
  393.      self at: #LDF_ASSIGNS             put: 16.
  394.      self at: #LDF_ENTRY               put: 32.
  395.      self at: #LDF_DELETE              put: 64.
  396.  
  397.      " you MUST specify one of LDF_READ or LDF_WRITE "
  398.      self at: #LDF_READ                put: 1.
  399.      self at: #LDF_WRITE               put: 2.
  400.  
  401.      " actually all but LDF_ENTRY (which is used for internal locking) "
  402.  
  403.      self at: #LDF_ALL                 put: 28. "LDF_DEVICES+LDF_VOLUMES+LDF_ASSIGNS"
  404.  
  405.      " error report types for ErrorReport() "
  406.  
  407.      self at: #REPORT_STREAM           put: 0.   " a stream "
  408.      self at: #REPORT_TASK             put: 1.   " a process - unused "
  409.      self at: #REPORT_LOCK             put: 2.   " a lock "
  410.      self at: #REPORT_VOLUME           put: 3.   " a volume node "
  411.      self at: #REPORT_INSERT           put: 4.   " please insert volume "
  412.  
  413.      " types for initial packets to shells from run/newcli/execute/system. "
  414.      " For shell-writers only "
  415.  
  416.      self at: #RUN_EXECUTE             put: -1.
  417.      self at: #RUN_SYSTEM              put: -2.
  418.      self at: #RUN_SYSTEM_ASYNCH       put: -3.
  419.  
  420.      " Types for fib_DirEntryType.   NOTE that both USERDIR and ROOT are
  421.      * directories, and that directory/file checks should use < 0 and >= 0.
  422.      * This is not necessarily exhaustive!   Some handlers may use other
  423.      * values as needed, though < 0 and >= 0 should remain as supported as
  424.      * possible.                         
  425.      "
  426.      self at: #ST_ROOT                 put: 1.
  427.      self at: #ST_USERDIR              put: 2.
  428.      self at: #ST_SOFTLINK             put: 3.  " looks like dir, but may point to a file! "
  429.      self at: #ST_LINKDIR              put: 4.  " hard link to dir "
  430.      self at: #ST_FILE                 put: -3. " must be negative for FIB! "
  431.      self at: #ST_LINKFILE             put: -4. " hard link to file "
  432.      self at: #ST_PIPEFILE             put: -5. " for pipes that support ExamineFH "
  433.  
  434.      " definitions for the System() call "
  435.  
  436.      self at: #SYS_Input        put: 16r80000021. " specifies the input filehandle "
  437.      self at: #SYS_Output       put: 16r80000022. " specifies the output filehandle "
  438.      self at: #SYS_Asynch       put: 16r80000023. " run asynch, close i/o on exit(!) "
  439.      self at: #SYS_UserShell    put: 16r80000024. " send to user shell instead of boot shell "
  440.      self at: #SYS_CustomShell  put: 16r80000025. " send to a specific shell (data is name) "
  441.  
  442.  
  443.      " definitions for the createNewProc: method.
  444.      * you MUST specify one of NP_Seglist or NP_Entry.  All else is optional. 
  445.      "
  446.      self at: #NP_Seglist       put: 16r80001001. " seglist of code to run for the process  "
  447.      self at: #NP_FreeSeglist   put: 16r80001002. " free seglist on exit - only valid for NP_Seglist.  Default is TRUE.      "
  448.      self at: #NP_Entry         put: 16r80001003. " entry point to run - mutually exclusive with NP_Seglist! "
  449.      self at: #NP_Input         put: 16r80001004. " filehandle - default is Open('NIL:'...) "
  450.      self at: #NP_Output        put: 16r80001005. " filehandle - default is Open('NIL:'...) "
  451.      self at: #NP_CloseInput    put: 16r80001006. " close input filehandle on exit default TRUE "
  452.      self at: #NP_CloseOutput   put: 16r80001007. " close output filehandle on exit default TRUE "
  453.      self at: #NP_Error         put: 16r80001008. " filehandle - default is Open('NIL:'...) "
  454.      self at: #NP_CloseError    put: 16r80001009. " close error filehandle on exit default TRUE "
  455.      self at: #NP_CurrentDir    put: 16r8000100A. " lock - default is parent's current dir  "
  456.      self at: #NP_StackSize     put: 16r8000100B. " stacksize for process - default 4000    "
  457.      self at: #NP_Name          put: 16r8000100C. " name for process - default 'New Process'"
  458.      self at: #NP_Priority      put: 16r8000100D. " priority - default same as parent      "
  459.      self at: #NP_ConsoleTask   put: 16r8000100E. " consoletask - default same as parent    "
  460.      self at: #NP_WindowPtr     put: 16r8000100F. " window ptr - default is same as parent  "
  461.      self at: #NP_HomeDir       put: 16r80001010. " home directory - default curr home dir  "
  462.      self at: #NP_CopyVars      put: 16r80001011. " boolean to copy local vars-default TRUE "
  463.      self at: #NP_Cli           put: 16r80001012. " create cli structure - default FALSE    "
  464.      self at: #NP_Path          put: 16r80001013. " path - default is copy of parents path  "
  465.                                                   " only valid if a cli process!      "
  466.      self at: #NP_CommandName   put: 16r80001014. " commandname - valid only for CLI      "
  467.      self at: #NP_Arguments     put: 16r80001015. " cstring of arguments - passed with str in a0, length in d0.   "
  468.  
  469.      self at: #NP_NotifyOnDeath put: 16r80001016. " notify parent on death - default FALSE  "
  470.      self at: #NP_Synchronous   put: 16r80001017. " don't return until process finishes -   "
  471.      self at: #NP_ExitCode      put: 16r80001018. " code to be called on process exit      "
  472.      self at: #NP_ExitData      put: 16r80001019. " optional argument for NP_EndCode rtn -  "
  473.  
  474.      " tags for AllocDosObject "
  475.  
  476.      self at: #ADO_FH_Mode      put: 16r80002001. " for type DOS_FILEHANDLE only! "
  477.                                                   " sets up FH for mode specified.
  478.                                                   * This can make a big difference for buffered
  479.                                                   * files.               
  480.                                                   "
  481.      " The following are for DOS_CLI.
  482.      * If you do not specify these, dos will use it's preferred values
  483.      * which may change from release to release.  The BPTRs to these
  484.      * will be set up correctly for you.  Everything will be zero,
  485.      * except cli_FailLevel (10) and cli_Background (DOSTRUE).
  486.      * NOTE:  You may also use these 4 tags with CreateNewProc.
  487.      "
  488.      self at: #ADO_DirLen       put: 16r80002002. " size in bytes for current dir buffer    "
  489.      self at: #ADO_CommNameLen  put: 16r80002003. " size in bytes for command name buffer   "
  490.      self at: #ADO_CommFileLen  put: 16r80002004. " size in bytes for command file buffer   "
  491.      self at: #ADO_PromptLen    put: 16r80002005  " size in bytes for the prompt buffer     "
  492. |
  493.    privateSetup
  494.      (uniqueInstance isNil)
  495.        ifTrue: [uniqueInstance <- self privateNew.
  496.  
  497.                 self privateInitializeDictionary
  498.                ].
  499.                
  500.      ^ self    "or ^ uniqueInstance??"
  501. ]
  502.  
  503. "----------------------------------------------------------------------"
  504. " DosErrors Class implements error number tags used by the AmigaDOS    "
  505. " functions for AmigaTalk.  This class is a Singleton-class.           "
  506. ""
  507. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  508. " methods of this Class -- it's really getting hard to document each   "
  509. " AmigaTalk Class in two or more places!                               "
  510. ""
  511. " ALL singleton classes MUST contain the following:                    "
  512. ""
  513. "   the methods:  isSingleton AND privateSetup     AND                 "
  514. "                 uniqueInstance Class instance variable.              "
  515. " ---------------------------------------------------------------------"
  516.  
  517. Class DosErrors :Dictionary ! uniqueInstance !
  518. [
  519.    isSingleton
  520.      ^ true  
  521. |  
  522.    privateNew ! newinstance !
  523.      newinstance <- super new.
  524.  
  525.      ^ newinstance
  526. |
  527.    new
  528.      ^ (self privateSetup)
  529. |
  530.    privateInitializeDictionary      "Too big to be in a Block:"
  531.  
  532.      " Special error codes for ErrorReport() "
  533.  
  534.      self at: #ABORT_DISK_ERROR        put: 296.   " Read/write error "
  535.      self at: #ABORT_BUSY              put: 288.   " You MUST replace... "
  536.  
  537.      " Error codes from IoErr(), etc. "
  538.  
  539.      self at: #ERROR_NO_FREE_STORE            put: 103.
  540.      self at: #ERROR_TASK_TABLE_FULL          put: 105.
  541.      self at: #ERROR_BAD_TEMPLATE             put: 114.
  542.      self at: #ERROR_BAD_NUMBER               put: 115.
  543.      self at: #ERROR_REQUIRED_ARG_MISSING     put: 116.
  544.      self at: #ERROR_KEY_NEEDS_ARG            put: 117.
  545.      self at: #ERROR_TOO_MANY_ARGS            put: 118.
  546.      self at: #ERROR_UNMATCHED_QUOTES         put: 119.
  547.      self at: #ERROR_LINE_TOO_LONG            put: 120.
  548.      self at: #ERROR_FILE_NOT_OBJECT          put: 121.
  549.      self at: #ERROR_INVALID_RESIDENT_LIBRARY put: 122.
  550.      self at: #ERROR_NO_DEFAULT_DIR           put: 201.
  551.      self at: #ERROR_OBJECT_IN_USE            put: 202.
  552.      self at: #ERROR_OBJECT_EXISTS            put: 203.
  553.      self at: #ERROR_DIR_NOT_FOUND            put: 204.
  554.      self at: #ERROR_OBJECT_NOT_FOUND         put: 205.
  555.      self at: #ERROR_BAD_STREAM_NAME          put: 206.
  556.      self at: #ERROR_OBJECT_TOO_LARGE         put: 207.
  557.      self at: #ERROR_ACTION_NOT_KNOWN         put: 209.
  558.      self at: #ERROR_INVALID_COMPONENT_NAME   put: 210.
  559.      self at: #ERROR_INVALID_LOCK             put: 211.
  560.      self at: #ERROR_OBJECT_WRONG_TYPE        put: 212.
  561.      self at: #ERROR_DISK_NOT_VALIDATED       put: 213.
  562.      self at: #ERROR_DISK_WRITE_PROTECTED     put: 214.
  563.      self at: #ERROR_RENAME_ACROSS_DEVICES    put: 215.
  564.      self at: #ERROR_DIRECTORY_NOT_EMPTY      put: 216.
  565.      self at: #ERROR_TOO_MANY_LEVELS          put: 217.
  566.      self at: #ERROR_DEVICE_NOT_MOUNTED       put: 218.
  567.      self at: #ERROR_SEEK_ERROR               put: 219.
  568.      self at: #ERROR_COMMENT_TOO_BIG          put: 220.
  569.      self at: #ERROR_DISK_FULL                put: 221.
  570.      self at: #ERROR_DELETE_PROTECTED         put: 222.
  571.      self at: #ERROR_WRITE_PROTECTED          put: 223.
  572.      self at: #ERROR_READ_PROTECTED           put: 224.
  573.      self at: #ERROR_NOT_A_DOS_DISK           put: 225.
  574.      self at: #ERROR_NO_DISK                  put: 226.
  575.      self at: #ERROR_NO_MORE_ENTRIES          put: 232.
  576.      self at: #ERROR_IS_SOFT_LINK             put: 233.
  577.      self at: #ERROR_OBJECT_LINKED            put: 234.
  578.      self at: #ERROR_BAD_HUNK                 put: 235.
  579.      self at: #ERROR_NOT_IMPLEMENTED          put: 236.
  580.      self at: #ERROR_RECORD_NOT_LOCKED        put: 240.
  581.      self at: #ERROR_LOCK_COLLISION           put: 241.
  582.      self at: #ERROR_LOCK_TIMEOUT             put: 242.
  583.      self at: #ERROR_UNLOCK_ERROR             put: 243.
  584.  
  585.      " error codes 303-305 are defined in dosasl.h "
  586.  
  587.      " These are the return codes used by convention by AmigaDOS commands
  588.      * See FAILAT and IF for relevance to EXECUTE (script) files
  589.      "
  590.      self at: #RETURN_OK                      put: 0.  " No problems, success "
  591.      self at: #RETURN_WARN                    put: 5.  " A warning only "
  592.      self at: #RETURN_ERROR                   put: 10. " Something wrong "
  593.      self at: #RETURN_FAIL                    put: 20. " Complete or severe failure "
  594.  
  595.      " Returns from matchFirst: & matchNext:
  596.      * You can also get dos error returns, such as ERROR_NO_MORE_ENTRIES,
  597.      * these are in the dos.h file.
  598.      "
  599.      self at: #ERROR_BUFFER_OVERFLOW   put: 303. " User or internal buffer overflow "
  600.      self at: #ERROR_BREAK             put: 304. " A break character was received "
  601.      self at: #ERROR_NOT_EXECUTABLE    put: 305  " A file has E bit cleared "
  602. |
  603.    privateSetup
  604.      (uniqueInstance isNil)
  605.        ifTrue: [uniqueInstance <- self privateNew.
  606.  
  607.                 self privateInitializeDictionary
  608.                ].
  609.                
  610.      ^ self    "or ^ uniqueInstance??"
  611. ]
  612.  
  613. "----------------------------------------------------------------------"
  614. " DosPackets Class implements flags & tags used by the AmigaDOS        "
  615. " functions for AmigaTalk.  This class is a Singleton-class.           "
  616. ""
  617. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  618. " methods of this Class -- it's really getting hard to document each   "
  619. " AmigaTalk Class in two or more places!                               "
  620. ""
  621. " ALL singleton classes MUST contain the following:                    "
  622. ""
  623. "   the methods:  isSingleton AND privateSetup     AND                 "
  624. "                 uniqueInstance Class instance variable.              "
  625. " ---------------------------------------------------------------------"
  626.  
  627. Class DosPackets :Dictionary ! uniqueInstance !
  628. [
  629.    isSingleton
  630.      ^ true  
  631. |  
  632.    privateNew ! newinstance !
  633.      newinstance <- super new.
  634.  
  635.      ^ newinstance
  636. |
  637.    new
  638.      ^ (self privateSetup)
  639. |
  640.    privateInitializeDictionary      "Too big to be in a Block:"
  641.  
  642.      " Packet types "
  643.  
  644.      self at: #ACTION_NIL              put: 0.
  645.      self at: #ACTION_STARTUP          put: 0.
  646.      self at: #ACTION_GET_BLOCK        put: 2.   " OBSOLETE "
  647.      self at: #ACTION_SET_MAP          put: 4.
  648.      self at: #ACTION_DIE              put: 5.
  649.      self at: #ACTION_EVENT            put: 6.
  650.      self at: #ACTION_CURRENT_VOLUME   put: 7.
  651.      self at: #ACTION_LOCATE_OBJECT    put: 8.
  652.      self at: #ACTION_RENAME_DISK      put: 9.
  653.      self at: #ACTION_WRITE            put: 16r57. " 'W' "
  654.      self at: #ACTION_READ             put: 16r52. " 'R' "
  655.      self at: #ACTION_FREE_LOCK        put: 15.
  656.      self at: #ACTION_DELETE_OBJECT    put: 16.
  657.      self at: #ACTION_RENAME_OBJECT    put: 17.
  658.      self at: #ACTION_MORE_CACHE       put: 18.
  659.      self at: #ACTION_COPY_DIR         put: 19.
  660.      self at: #ACTION_WAIT_CHAR        put: 20.
  661.      self at: #ACTION_SET_PROTECT      put: 21.
  662.      self at: #ACTION_CREATE_DIR       put: 22.
  663.      self at: #ACTION_EXAMINE_OBJECT   put: 23.
  664.      self at: #ACTION_EXAMINE_NEXT     put: 24.
  665.      self at: #ACTION_DISK_INFO        put: 25.
  666.      self at: #ACTION_INFO             put: 26.
  667.      self at: #ACTION_FLUSH            put: 27.
  668.      self at: #ACTION_SET_COMMENT      put: 28.
  669.      self at: #ACTION_PARENT           put: 29.
  670.      self at: #ACTION_TIMER            put: 30.
  671.      self at: #ACTION_INHIBIT          put: 31.
  672.      self at: #ACTION_DISK_TYPE        put: 32.
  673.      self at: #ACTION_DISK_CHANGE      put: 33.
  674.      self at: #ACTION_SET_DATE         put: 34.
  675.  
  676.      self at: #ACTION_SCREEN_MODE      put: 994.
  677.  
  678.      self at: #ACTION_READ_RETURN      put: 1001.
  679.      self at: #ACTION_WRITE_RETURN     put: 1002.
  680.      self at: #ACTION_SEEK             put: 1008.
  681.      self at: #ACTION_FINDUPDATE       put: 1004.
  682.      self at: #ACTION_FINDINPUT        put: 1005.
  683.      self at: #ACTION_FINDOUTPUT       put: 1006.
  684.      self at: #ACTION_END              put: 1007.
  685.      self at: #ACTION_SET_FILE_SIZE    put: 1022.   " fast file system only in 1.3 "
  686.      self at: #ACTION_WRITE_PROTECT    put: 1023.   " fast file system only in 1.3 "
  687.  
  688.      self at: #ACTION_SAME_LOCK        put: 40.
  689.      self at: #ACTION_CHANGE_SIGNAL    put: 995.
  690.      self at: #ACTION_FORMAT           put: 1020.
  691.      self at: #ACTION_MAKE_LINK        put: 1021.
  692.      self at: #ACTION_READ_LINK        put: 1024.
  693.      self at: #ACTION_FH_FROM_LOCK     put: 1026.
  694.      self at: #ACTION_IS_FILESYSTEM    put: 1027.
  695.      self at: #ACTION_CHANGE_MODE      put: 1028.
  696.      self at: #ACTION_COPY_DIR_FH      put: 1030.
  697.      self at: #ACTION_PARENT_FH        put: 1031.
  698.      self at: #ACTION_EXAMINE_ALL      put: 1033.
  699.      self at: #ACTION_EXAMINE_FH       put: 1034.
  700.  
  701.      self at: #ACTION_LOCK_RECORD      put: 2008.
  702.      self at: #ACTION_FREE_RECORD      put: 2009.
  703.  
  704.      self at: #ACTION_ADD_NOTIFY       put: 4097.
  705.      self at: #ACTION_REMOVE_NOTIFY    put: 4098.
  706.  
  707.      " Added in V39: "
  708.  
  709.      self at: #ACTION_EXAMINE_ALL_END  put: 1035.
  710.      self at: #ACTION_SET_OWNER        put: 1036.
  711.  
  712.      " Tell a file system to serialize the current volume.  This is typically
  713.      * done by changing the creation date of the disk.  This packet does not 
  714.      * take any arguments.  
  715.      * NOTE:  Be prepared to handle failure of this packet for V37 ROM 
  716.      *        filesystems.
  717.      "
  718.      self at: #ACTION_SERIALIZE_DISK   put: 4200
  719. |
  720.    privateSetup
  721.      (uniqueInstance isNil)
  722.        ifTrue: [uniqueInstance <- self privateNew.
  723.  
  724.                 self privateInitializeDictionary
  725.                ].
  726.                
  727.      ^ self    "or ^ uniqueInstance??"
  728.  
  729. ]
  730.  
  731. "----------------------------------------------------------------------"
  732. " DosFH Class implements FileHandler flags & tags used by the AmigaDOS "
  733. " functions for AmigaTalk.  This class is a Singleton-class.           "
  734. ""
  735. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  736. " methods of this Class -- it's really getting hard to document each   "
  737. " AmigaTalk Class in two or more places!                               "
  738. ""
  739. " ALL singleton classes MUST contain the following:                    "
  740. ""
  741. "   the methods:  isSingleton AND privateSetup     AND                 "
  742. "                 uniqueInstance Class instance variable.              "
  743. " ---------------------------------------------------------------------"
  744.  
  745. Class DosFH :Dictionary ! uniqueInstance !
  746. [
  747.    isSingleton
  748.      ^ true  
  749. |  
  750.    privateNew ! newinstance !
  751.      newinstance <- super new.
  752.  
  753.      ^ newinstance
  754. |
  755.    new
  756.      ^ (self privateSetup)
  757. |
  758.    privateSetup
  759.      (uniqueInstance isNil)
  760.        ifTrue: [uniqueInstance <- self privateNew.
  761.  
  762.                 " dos/FileHandler.h flags: "
  763.  
  764.                 " these are the offsets into the DiskEnvironment (struct DosEnvec) array 
  765.                 * DE_TABLESIZE is set to the number of longwords in the table minus 1 
  766.                 "
  767.                 self at: #DE_TABLESIZE    put: 0.  " minimum value is 11 (includes NumBuffers) "
  768.                 self at: #DE_SIZEBLOCK    put: 1.  " in longwords: standard value is 128 "
  769.                 self at: #DE_SECORG       put: 2.  " not used; must be 0 "
  770.                 self at: #DE_NUMHEADS     put: 3.  " # of heads (surfaces). drive specific "
  771.                 self at: #DE_SECSPERBLK   put: 4.  " not used; must be 1 "
  772.                 self at: #DE_BLKSPERTRACK put: 5.  " blocks per track. drive specific "
  773.                 self at: #DE_RESERVEDBLKS put: 6.  " unavailable blocks at start.    usually 2 "
  774.                 self at: #DE_PREFAC       put: 7.  " not used; must be 0 "
  775.                 self at: #DE_INTERLEAVE   put: 8.  " usually 0 "
  776.                 self at: #DE_LOWCYL       put: 9.  " starting cylinder. typically 0 "
  777.                 self at: #DE_UPPERCYL     put: 10. " max cylinder.  drive specific "
  778.                 self at: #DE_NUMBUFFERS   put: 11. " starting # of buffers.  typically 5 "
  779.                 self at: #DE_BUFMEMTYPE   put: 12. " type of mem to allocate for buffers.
  780.                                                    * 1 is public, 3 is chip, 5 is fast 
  781.                                                    "
  782.                 self at: #DE_MAXTRANSFER  put: 13. " Max number bytes to transfer at a time "
  783.                 self at: #DE_MASK         put: 14. " Address Mask to block out certain memory "
  784.                 self at: #DE_BOOTPRI      put: 15. " Boot priority for autoboot "
  785.                 self at: #DE_DOSTYPE      put: 16. " string showing filesystem type "
  786.                 self at: #DE_BAUD         put: 17. " Baud rate for serial handler "
  787.                 self at: #DE_CONTROL      put: 18. " Control word for handler/filesystem "
  788.                 self at: #DE_BOOTBLOCKS   put: 19. " Number of blocks containing boot code "
  789.                ].
  790.                
  791.      ^ self    "or ^ uniqueInstance??"
  792. ]
  793.  
  794. "----------------------------------------------------------------------"
  795. " DosNotifyFlags Class implements Notify flags & tags used by the      "
  796. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  797. ""
  798. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  799. " methods of this Class -- it's really getting hard to document each   "
  800. " AmigaTalk Class in two or more places!                               "
  801. ""
  802. " ALL singleton classes MUST contain the following:                    "
  803. ""
  804. "   the methods:  isSingleton AND privateSetup     AND                 "
  805. "                 uniqueInstance Class instance variable.              "
  806. " ---------------------------------------------------------------------"
  807.  
  808. Class DosNotifyFlags :Dictionary ! uniqueInstance !
  809. [
  810.    isSingleton
  811.      ^ true  
  812. |  
  813.    privateNew ! newinstance !
  814.      newinstance <- super new.
  815.  
  816.      ^ newinstance
  817. |
  818.    new
  819.      ^ (self privateSetup)
  820. |
  821.    privateSetup
  822.      (uniqueInstance isNil)
  823.        ifTrue: [uniqueInstance <- self privateNew.
  824.  
  825.                 " dos/Notify.h flags: "
  826.  
  827.                 " use of Class and code is discouraged for the time being - we might want to
  828.                 * change things 
  829.                 "
  830.                 self at: #NOTIFY_CLASS    put: 16r40000000. " NotifyMessage Class "
  831.                 self at: #NOTIFY_CODE     put: 16r1234. " NotifyMessage Codes "
  832.  
  833.                 " --- NotifyRequest Flags ------------------------------------------------ "
  834.  
  835.                 self at: #NRF_SEND_MESSAGE    put: 1.
  836.                 self at: #NRF_SEND_SIGNAL     put: 2.
  837.                 self at: #NRF_WAIT_REPLY      put: 8.
  838.                 self at: #NRF_NOTIFY_INITIAL  put: 16.
  839.  
  840.                 " do NOT set or remove NRF_MAGIC!  Only for use by handlers! "
  841.  
  842.                 self at: #NRF_MAGIC           put: 16r80000000.
  843.  
  844.                 " Flags reserved for private use by the handler: "
  845.  
  846.                 self at: #NR_HANDLER_FLAGS    put: 16rFFFF0000
  847.                ].
  848.                
  849.      ^ self    "or ^ uniqueInstance??"
  850. ]
  851.  
  852.  
  853. "----------------------------------------------------------------------"
  854. " DosRDArgsFlags Class implements RDArgs flags & tags used by the      "
  855. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  856. ""
  857. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  858. " methods of this Class -- it's really getting hard to document each   "
  859. " AmigaTalk Class in two or more places!                               "
  860. ""
  861. " ALL singleton classes MUST contain the following:                    "
  862. ""
  863. "   the methods:  isSingleton AND privateSetup     AND                 "
  864. "                 uniqueInstance Class instance variable.              "
  865. " ---------------------------------------------------------------------"
  866.  
  867. Class DosRDArgsFlags :Dictionary ! uniqueInstance !
  868. [
  869.    isSingleton
  870.      ^ true  
  871. |  
  872.    privateNew ! newinstance !
  873.      newinstance <- super new.
  874.  
  875.      ^ newinstance
  876. |
  877.    new
  878.      ^ (self privateSetup)
  879. |
  880.    privateSetup
  881.      (uniqueInstance isNil)
  882.        ifTrue: [uniqueInstance <- self privateNew.
  883.  
  884.                 " dos/RDArgs.h flags: "
  885.  
  886.                 self at: #RDAF_STDIN     put: 1.   " Use 'STDIN' rather than 'COMMAND LINE' "
  887.                 self at: #RDAF_NOALLOC   put: 2.   " If set, do not allocate extra string spc"
  888.                 self at: #RDAF_NOPROMPT  put: 4.   " Disable reprompting for string input. "
  889.  
  890.                 " Maximum number of template keywords which can be in a template passed
  891.                 * to ReadArgs(). IMPLEMENTOR NOTE - must be a multiple of 4.
  892.                 "
  893.                 self at: #MAX_TEMPLATE_ITEMS  put: 100.
  894.  
  895.                 " Maximum number of MULTIARG items returned by ReadArgs(), before
  896.                 * an ERROR_LINE_TOO_LONG.  These two limitations are due to stack
  897.                 * usage.  Applications should allow 'a lot' of stack to use ReadArgs().
  898.                 "
  899.                 self at: #MAX_MULTIARGS       put: 128
  900.                ].
  901.                
  902.      ^ self    "or ^ uniqueInstance??"
  903. ]
  904.  
  905. "----------------------------------------------------------------------"
  906. " DosRecordFlags Class implements Record flags & tags used by the      "
  907. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  908. ""
  909. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  910. " methods of this Class -- it's really getting hard to document each   "
  911. " AmigaTalk Class in two or more places!                               "
  912. ""
  913. " ALL singleton classes MUST contain the following:                    "
  914. ""
  915. "   the methods:  isSingleton AND privateSetup     AND                 "
  916. "                 uniqueInstance Class instance variable.              "
  917. " ---------------------------------------------------------------------"
  918.  
  919. Class DosRecordFlags :Dictionary ! uniqueInstance !
  920. [
  921.    isSingleton
  922.      ^ true  
  923. |  
  924.    privateNew ! newinstance !
  925.      newinstance <- super new.
  926.  
  927.      ^ newinstance
  928. |
  929.    new
  930.      ^ (self privateSetup)
  931. |
  932.    privateSetup
  933.      (uniqueInstance isNil)
  934.        ifTrue: [uniqueInstance <- self privateNew.
  935.  
  936.                 " dos/Record.h flags: "
  937.  
  938.                 " Modes for lockRecord: & lockRecords: "
  939.  
  940.                 self at: #REC_EXCLUSIVE         put: 0.
  941.                 self at: #REC_EXCLUSIVE_IMMED   put: 1.
  942.                 self at: #REC_SHARED            put: 2.
  943.                 self at: #REC_SHARED_IMMED      put: 3.
  944.                ].
  945.                
  946.      ^ self    "or ^ uniqueInstance??"
  947. ]
  948.  
  949. "----------------------------------------------------------------------"
  950. " DosStdIOFlags Class implements stdio flags & tags used by the        "
  951. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  952. ""
  953. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  954. " methods of this Class -- it's really getting hard to document each   "
  955. " AmigaTalk Class in two or more places!                               "
  956. ""
  957. " ALL singleton classes MUST contain the following:                    "
  958. ""
  959. "   the methods:  isSingleton AND privateSetup     AND                 "
  960. "                 uniqueInstance Class instance variable.              "
  961. " ---------------------------------------------------------------------"
  962.  
  963. Class DosStdIOFlags :Dictionary ! uniqueInstance !
  964. [
  965.    isSingleton
  966.      ^ true  
  967. |  
  968.    privateNew ! newinstance !
  969.      newinstance <- super new.
  970.  
  971.      ^ newinstance
  972. |
  973.    new
  974.      ^ (self privateSetup)
  975. |
  976.    privateSetup
  977.      (uniqueInstance isNil)
  978.        ifTrue: [uniqueInstance <- self privateNew.
  979.  
  980.                 " dos/stdio.h flags: "
  981.  
  982.                 " types for SetVBuf "
  983.  
  984.                 self at: #BUF_LINE    put: 0.  " flush on \n, etc "
  985.                 self at: #BUF_FULL    put: 1.  " never flush except when needed "
  986.                 self at: #BUF_NONE    put: 2.  " no buffering "
  987.            
  988.                 self at: #ENDSTREAMCH put: -1. " EOF return value "
  989.                ].
  990.                
  991.      ^ self    "or ^ uniqueInstance??"
  992. ]
  993.  
  994.  
  995. "----------------------------------------------------------------------"
  996. " DosVarFlags Class implements variable flags & tags used by the       "
  997. " AmigaDOS functions for AmigaTalk.  This class is a Singleton-class.  "
  998. ""
  999. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  1000. " methods of this Class -- it's really getting hard to document each   "
  1001. " AmigaTalk Class in two or more places!                               "
  1002. ""
  1003. " ALL singleton classes MUST contain the following:                    "
  1004. ""
  1005. "   the methods:  isSingleton AND privateSetup     AND                 "
  1006. "                 uniqueInstance Class instance variable.              "
  1007. " ---------------------------------------------------------------------"
  1008.  
  1009. Class DosVarFlags :Dictionary ! uniqueInstance !
  1010. [
  1011.    isSingleton
  1012.      ^ true  
  1013. |  
  1014.    privateNew ! newinstance !
  1015.      newinstance <- super new.
  1016.  
  1017.      ^ newinstance
  1018. |
  1019.    new
  1020.      ^ (self privateSetup)
  1021. |
  1022.    privateSetup
  1023.      (uniqueInstance isNil)
  1024.        ifTrue: [uniqueInstance <- self privateNew.
  1025.  
  1026.                 " dos/Var.h flags: "
  1027.  
  1028.                 " bit definitions for localVar->lv_Node.ln_Type: "
  1029.  
  1030.                 self at: #LV_VAR      put: 0.   " an variable "
  1031.                 self at: #LV_ALIAS    put: 1.   " an alias "
  1032.  
  1033.                 " to be or'ed into type: "
  1034.  
  1035.                 self at: #LVB_IGNORE  put: 7.      " ignore this entry on GetVar, etc "
  1036.                 self at: #LVF_IGNORE  put: 16r80.
  1037.  
  1038.                 " definitions of flags passed to GetVar()/SetVar()/DeleteVar()
  1039.                 * bit defs to be OR'ed with the type:
  1040.                 * item will be treated as a single line of text unless BINARY_VAR is used 
  1041.                 "
  1042.                 self at: #GVF_GLOBAL_ONLY     put: 16r100.
  1043.                 self at: #GVF_LOCAL_ONLY      put: 16r200.
  1044.                 self at: #GVF_BINARY_VAR      put: 16r400.
  1045.                 self at: #GVF_DONT_NULL_TERM  put: 16r800. " only with GVF_BINARY_VAR "
  1046.  
  1047.                 " this is only supported in >= V39 dos.  V37 dos ignores this.
  1048.                 * this causes SetVar to affect ENVARC: as well as ENV:.   
  1049.                 "
  1050.                 self at: #GVF_SAVE_VAR        put: 16r1000. " only with GVF_GLOBAL_ONLY "
  1051.                ].
  1052.                
  1053.      ^ self    "or ^ uniqueInstance??"
  1054. ]
  1055.  
  1056. "----------------------------------------------------------------------"
  1057. " DosDateTimeFlags Class implements flags & tags used by the AmigaDOS  "
  1058. " functions for AmigaTalk.  This class is a Singleton-class.           "
  1059. ""
  1060. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  1061. " methods of this Class -- it's really getting hard to document each   "
  1062. " AmigaTalk Class in two or more places!                               "
  1063. ""
  1064. " ALL singleton classes MUST contain the following:                    "
  1065. ""
  1066. "   the methods:  isSingleton AND privateSetup     AND                 "
  1067. "                 uniqueInstance Class instance variable.              "
  1068. " ---------------------------------------------------------------------"
  1069.  
  1070. Class DosDateTimeFlags :Dictionary ! uniqueInstance !
  1071. [
  1072.    isSingleton
  1073.      ^ true  
  1074. |  
  1075.    privateNew ! newinstance !
  1076.      newinstance <- super new.
  1077.  
  1078.      ^ newinstance
  1079. |
  1080.    new
  1081.      ^ (self privateSetup)
  1082. |
  1083.    privateSetup     
  1084.      (uniqueInstance isNil)
  1085.        ifTrue: [uniqueInstance <- self privateNew.
  1086.  
  1087.                 self at: #DTF_SUBST     put: 16r1.
  1088.                 self at: #DTF_FUTURE    put: 16r2.
  1089.                 self at: #FORMAT_DOS    put: 16r0.  " Date Formatting flags "
  1090.                 self at: #FORMAT_INT    put: 16r1.
  1091.                 self at: #FORMAT_USA    put: 16r2.
  1092.                 self at: #FORMAT_CDN    put: 16r3.
  1093.                 self at: #FORMAT_MAX    put: 16r3.
  1094.                 self at: #LEN_DATSTRING put: 16r10.
  1095.                ].
  1096.                
  1097.      ^ self    "or ^ uniqueInstance??"
  1098. ]
  1099.  
  1100. "----------------------------------------------------------------------"
  1101. " DosHunks Class implements hunk flags & tags used by the AmigaDOS     "
  1102. " functions for AmigaTalk.  This class is a Singleton-class.           "
  1103. ""
  1104. " Please read AmigaTalk:Help/ADos.guide for guidance on how to use the "
  1105. " methods of this Class -- it's really getting hard to document each   "
  1106. " AmigaTalk Class in two or more places!                               "
  1107. ""
  1108. " ALL singleton classes MUST contain the following:                    "
  1109. ""
  1110. "   the methods:  isSingleton AND privateSetup     AND                 "
  1111. "                 uniqueInstance Class instance variable.              "
  1112. " ---------------------------------------------------------------------"
  1113.  
  1114. Class DosHunks :Dictionary ! uniqueInstance !
  1115. [
  1116.    isSingleton
  1117.      ^ true  
  1118. |  
  1119.    privateNew ! newinstance !
  1120.      newinstance <- super new.
  1121.  
  1122.      ^ newinstance
  1123. |
  1124.    new
  1125.      ^ (self privateSetup)
  1126. |
  1127.    privateInitializeDictionary      "Too big to be in a Block:"
  1128.  
  1129.      " dos/DosHunks.h flags: (NOT Currently used 31-Dec-2001)"
  1130.      " hunk types "
  1131.  
  1132.      self at: #HUNK_UNIT               put: 999.
  1133.      self at: #HUNK_NAME               put: 1000.
  1134.      self at: #HUNK_CODE               put: 1001.
  1135.      self at: #HUNK_DATA               put: 1002.
  1136.      self at: #HUNK_BSS                put: 1003.
  1137.      self at: #HUNK_RELOC32            put: 1004.
  1138.      self at: #HUNK_ABSRELOC32         put: 1004.
  1139.      self at: #HUNK_RELOC16            put: 1005.
  1140.      self at: #HUNK_RELRELOC16         put: 1005.
  1141.      self at: #HUNK_RELOC8             put: 1006.
  1142.      self at: #HUNK_RELRELOC8          put: 1006.
  1143.      self at: #HUNK_EXT                put: 1007.
  1144.      self at: #HUNK_SYMBOL             put: 1008.
  1145.      self at: #HUNK_DEBUG              put: 1009.
  1146.      self at: #HUNK_END                put: 1010.
  1147.      self at: #HUNK_HEADER             put: 1011.
  1148.      self at: #HUNK_OVERLAY            put: 1013.
  1149.      self at: #HUNK_BREAK              put: 1014.
  1150.      self at: #HUNK_DREL32             put: 1015.
  1151.      self at: #HUNK_DREL16             put: 1016.
  1152.      self at: #HUNK_DREL8              put: 1017.
  1153.      self at: #HUNK_LIB                put: 1018.
  1154.      self at: #HUNK_INDEX              put: 1019.
  1155.  
  1156.      " Note: V37 loadSeg: uses 1015 (HUNK_DREL32) by mistake.  This will continue
  1157.      * to be supported in future versions, since HUNK_DREL32 is illegal in load files
  1158.      * anyways.  Future versions will support both 1015 and 1020, though anything
  1159.      * that should be usable under V37 should use 1015.
  1160.      "
  1161.      self at: #HUNK_RELOC32SHORT       put: 1020.
  1162.  
  1163.      " see ext_xxx below.  New for V39 (note that loadSeg: only handles RELRELOC32)."
  1164.      self at: #HUNK_RELRELOC32         put: 1021.
  1165.      self at: #HUNK_ABSRELOC16         put: 1022.
  1166.  
  1167.      " Any hunks that have the HUNKB_ADVISORY bit set will be ignored if they
  1168.      * aren't understood.  When ignored, they're treated like HUNK_DEBUG hunks.
  1169.      * NOTE: this handling of HUNKB_ADVISORY started as of V39 dos.library!  If
  1170.      * loading such executables is attempted under <V39 dos, it will fail with a
  1171.      * bad hunk type.
  1172.      "
  1173.      self at: #HUNKF_ADVISORY          put: 16r20000000.
  1174.      self at: #HUNKF_CHIP              put: 16r40000000.
  1175.      self at: #HUNKF_FAST              put: 16r80000000.
  1176.  
  1177.      " hunk_ext sub-types "
  1178.  
  1179.      self at: #EXT_SYMB                put: 0.   " symbol table "
  1180.      self at: #EXT_DEF                 put: 1.   " relocatable definition "
  1181.      self at: #EXT_ABS                 put: 2.   " Absolute definition "
  1182.      self at: #EXT_RES                 put: 3.   " no longer supported "
  1183.      self at: #EXT_REF32               put: 129. " 32 bit absolute reference to symbol "
  1184.      self at: #EXT_ABSREF32            put: 129.
  1185.      self at: #EXT_COMMON              put: 130. " 32 bit absolute reference to COMMON block "
  1186.      self at: #EXT_ABSCOMMON           put: 130.
  1187.      self at: #EXT_REF16               put: 131. " 16 bit PC-relative reference to symbol "
  1188.      self at: #EXT_RELREF16            put: 131.
  1189.      self at: #EXT_REF8                put: 132. "  8 bit PC-relative reference to symbol "
  1190.      self at: #EXT_RELREF8             put: 132.
  1191.      self at: #EXT_DEXT32              put: 133. " 32 bit data relative reference "
  1192.      self at: #EXT_DEXT16              put: 134. " 16 bit data relative reference "
  1193.      self at: #EXT_DEXT8               put: 135. "  8 bit data relative reference "
  1194.  
  1195.      " These are to support some of the '020 and up modes that are rarely used "
  1196.      self at: #EXT_RELREF32            put: 136. " 32 bit PC-relative reference to symbol "
  1197.      self at: #EXT_RELCOMMON           put: 137. " 32 bit PC-relative ref' to COMMON block "
  1198.  
  1199.      " for completeness... All 680x0's support this "
  1200.      self at: #EXT_ABSREF16            put: 138.   " 16 bit absolute reference to symbol "
  1201.  
  1202.      " this only exists on '020's and above, in the (d8,An,Xn) address mode "
  1203.      self at: #EXT_ABSREF8             put: 139    " 8 bit absolute reference to symbol "
  1204. |
  1205.    privateSetup
  1206.      (uniqueInstance isNil)
  1207.        ifTrue: [uniqueInstance <- self privateNew.
  1208.  
  1209.                 self privateInitializeDictionary
  1210.                ].
  1211.                
  1212.      ^ self    "or ^ uniqueInstance??"
  1213. ]
  1214.